﻿@model IEnumerable<Irandeb4.Models.Product>

@{
    ViewBag.Title = "Search";
}

<h2>Buscar Producto</h2>

@using (Html.BeginForm())
{
    <center>
        <div>
            <input type="text" id="searchFieldID" name="toSearch"/> 
            <input type="submit" value="buscar" />   
        </div>
    </center>
    
     <div>
        <a href="Search">ver todas</a>
    </div>

    <table class="table2">
        <tr>           
            <th>
                Nombre
            </th>
            <th>
                Tipo
            </th>
            <th>
                Descripción
            </th>
            <th>
                Proveedor(es)
            </th>
            <th>
                Acciones    
            </th>            
        </tr>

    @foreach (var item in Model)
    {        
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Type)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Description)
                </td>
                <td align="center">
                    @Html.ActionLink("Ver Proveedores", "SeeSuppliers", new { id = item.ProductId })
                </td>
                
                <td align="center">                    
                    @Html.ActionLink("Modificar", "Edit", new { id = item.ProductId }) |
                    @Html.ActionLink("Ver", "Details", new { id = item.ProductId }) |
                    @Html.ActionLink("Eliminar", "Delete", new { id = item.ProductId })
                </td>
            </tr>
        
    }

    </table>
}
